#!/bin/bash

for i in $( ls *.bgr );
do
  bgrfile=$i
  txtfile=$( echo $i | sed -e "s/bgr/txt/" )
  dsafile=$( echo $i | sed -e "s/bgr/dsa/" )
  echo subtracting background signal from $txtfile
  ./bgsub ./$txtfile ./$bgrfile ./$dsafile
done

